#include <iostream>
#include"matrix.h"
#include<stdlib.h>
#include<time.h>
using namespace std;

int main()
{
  srand((unsigned)time(0));
  int col1,col2,row1,row2;
  cin>>row1;
  cin>>col1;
  row2=col1;
  cin>>col2;
    Matrix<double> m1(row1,col1);
      Matrix<double> m2(row2,col2);  
  for(int i=0;i<row1*col1;i++)
    m1.get_element()[i]=(double)(rand()%10000+1)/100;
     for(int i=0;i<row1;i++){
      for(int j=0;j<col1;j++)
	cout<<m1.get_element()[i*col1+j] <<"\t";
      cout<< endl;
       }
     cout<<"-------------------------"<< endl;
     for(int i=0;i<row2*col2;i++)
       m2.get_element()[i]=(double)(rand()%10000+1)/100;
      for(int i=0;i<row2;i++){
      for(int j=0;j<col2;j++)
	cout<<m2.get_element()[i*col2+j] <<"\t";
      cout<< endl;
      }
  bool k1,k2;
  k1=m1.is_square();
  if(k1==true)
    cout<<"The first matrix is a square matrix" << endl;
  if(k1==false)
    cout<<"The first matrix is not a square matrix" << endl;
  k2=m2.is_square();
  if(k2==true)
    cout<<"The second matrix is a square matrix" <<endl;
    if(k2==false)
    cout<<"The second matrix is not a square matrix" <<endl;
     Matrix<double> m3=m1*m2;
     cout<<"-------------------------" << endl;
      for(int i=0;i<row1;i++){
      for(int j=0;j<col2;j++)
	cout<<m3.get_element()[i*col2+j] <<"\t";
      cout<< endl;   
}
       RowVector<double> r1(5);
      RowVector<double> r2(5);
      for(int i=0;i<5;i++)
	{
	r1.get_RowVector_element()[i]=(double)(rand()%10000+1)/100;
      	r2.get_RowVector_element()[i]=(double)(rand()%10000+1)/100;
        }
       for(int i=0;i<5;i++)
	{
      	cout << r1.get_RowVector_element()[i] <<"\t";
	}
	cout << endl;
	for(int i=0;i<5;i++)
	{cout << r2.get_RowVector_element()[i] <<"\t";
	}
	cout << endl;
      double result=r1*r2;
      cout <<result;
      return 0;
}
  
  
